home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Full / NetObjects Fusion 9 Standard / NOF9_Full_EN.exe / data1.cab / FSI / lib / nof / Event.js < prev    next >
Encoding:
Text File  |  2005-11-16  |  3.3 KB  |  134 lines

  1. /****i* SOURCE_FILE/INFO
  2.     *
  3.     * NAME
  4.     *  Event.js
  5.     *
  6.     * USAGE
  7.     *  Part of Netobjects JavaScript Library.
  8.     *
  9.     * COPYRIGHT
  10.     *  Copyright ⌐ 2000-2005 Website Pros, Inc.
  11.     *  All Rights Reserved.
  12.     *
  13.     *  This is an unpublished work protected by Website Pros, Inc.
  14.     *  as a trade secret, and is not to be used or disclosed except as
  15.     *  expressly provided in a written license agreement executed by
  16.     *  you and Website Pros, Inc.
  17.     *
  18.     *      <copyright@websitepros.com>
  19.     *
  20.     * NOTES
  21.     *  JavaScript code.
  22.     *
  23.     *****/
  24. if (!IS.isModuleInitialized("IS.NOF.EventObject"))
  25. {
  26.     /****h* NOF_JavaScript_Library/NOF.EventObject
  27.     *
  28.     * NAME
  29.     *  NOF.EventObject
  30.     *
  31.     * DESCRIPTION
  32.     *  encapsulates generic events in Fusion. Base class for all types of events.
  33.     *    
  34.     ****/
  35.     
  36.     /**
  37.     * Constructor    
  38.     * @param id
  39.     * @param source
  40.     **/
  41.     function NOF_EventObject( id, source ){
  42.         this.__proto__ = NOF_EventObject.prototype;
  43.         this.id     = id;
  44.         this.source = source;    
  45.     }
  46.     {
  47.         var method = NOF_EventObject.prototype;
  48.         method.getSource = function (){return this.source;};
  49.         method.getID     = function (){return this.id;};
  50.         method.setID     = function ( id ){this.id = id;};
  51.         
  52.         method.equals    = function (_evt) {
  53.             if (this.id == _evt.getID() && this.source == _evt.getSource())
  54.                 return true;
  55.             return false;
  56.         }
  57.         
  58.         method.toString  = function (){
  59.             var source = this.source;
  60.             if (typeof(this.source)  == 'object' && this.source != null)
  61.                 if (typeof(this.source.dump) == 'function'){
  62.                     source = this.source.dump();
  63.                 }else{
  64.                     source = this.source.toString();
  65.                 }
  66.             
  67.             return "id: " + this.id +  "source: " + source;
  68.         }
  69.     }
  70.     
  71.     NOF.__proto__.EventObject = NOF_EventObject;
  72.     NOF.addVariable( "EventObject.GENERIC_EVENT", "GENERIC_EVENT" );
  73.     
  74.     /****h* NOF_JavaScript_Library/NOF.MenuEvent
  75.     *
  76.     * NAME
  77.     *  NOF.MenuEvent
  78.     *
  79.     * DESCRIPTION
  80.     *  encapsulates events occured in a menu.
  81.     *    
  82.     ****/
  83.     
  84.     /**
  85.     * Constructor    
  86.     * @param type
  87.     * @param source
  88.     **/    
  89.     function NOF_MenuEvent( type, source ){
  90.         this.__proto__   = NOF_MenuEvent.prototype;
  91.         
  92.         this.SUPER(type, source);
  93.     }
  94.     NOF_MenuEvent.inherits(NOF_EventObject);  
  95.     NOF.__proto__.MenuEvent   = NOF_MenuEvent;
  96.  
  97.     NOF.addVariable("MenuEvent.ITEM_SELECTED", "ITEM_SELECTED");
  98.     NOF.addVariable("MenuEvent.ITEM_DESELECTED", "ITEM_DESELECTED");
  99.     
  100.     
  101.     /****h* NOF_JavaScript_Library/NOF.WindowEvent
  102.     *
  103.     * NAME
  104.     *  NOF.WindowEvent
  105.     *
  106.     * DESCRIPTION
  107.     *  encapsulates events occured in a window.
  108.     *    
  109.     ****/
  110.     
  111.     /**
  112.     * Constructor    
  113.     * @param type
  114.     * @param source
  115.     **/        
  116.     function NOF_WindowEvent( type, source ){
  117.         this.__proto__   = NOF_WindowEvent.prototype;
  118.         
  119.         this.SUPER(type, source);
  120.     }
  121.     NOF_WindowEvent.inherits(NOF_EventObject); 
  122.     NOF.__proto__.WindowEvent = NOF_WindowEvent;
  123.     
  124.     NOF.addVariable("WindowEvent.ITEM_SELECTED", "WINDOW_CLOSED");
  125.     NOF.addVariable("WindowEvent.WINDOW_INITIALISED", "WINDOW_INITIALISED");
  126.     NOF.addVariable("WindowEvent.DIALOG_OK", "DialogOk");
  127.     NOF.addVariable("WindowEvent.DIALOG_CANCEL", "DialogCancel");
  128.     NOF.addVariable("WindowEvent.DIALOG_CLOSED", "DIALOG_CLOSED");
  129.     NOF.addVariable("WindowEvent.DATAUPDATE_TO_CTRL", "DATAUPDATE_TO");  
  130.     NOF.addVariable("WindowEvent.DATAUPDATE_FROM_CTRL", "DATAUPDATE_FROM");    
  131.     
  132. }
  133.  
  134.